package com.wr.service.comment;

import com.alibaba.fastjson.JSONObject;
import com.wr.dao.CommentDao;
import com.wr.model.Comment;
import com.wr.model.RestResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author weirong
 * @Title:
 * @Description:
 * @date 2018/6/1315:38
 */
@Service
public class CommentServiceImpl implements CommentService {

    @Autowired
    private CommentDao commentDao;
    @Override
    public void add(Comment comment) {
        commentDao.add(comment);
    }

    @Override
    public JSONObject listByArtId(Integer artid,Integer pageSize) {

        RestResponse<JSONObject> rest = commentDao.listByArtId(artid,pageSize);

        return rest.getResult();
    }
}
